<?php
/**
 * @ClassName: WebConfigLogic
 * @Description: TODO
 * @author: wyaohu
 * @Date: 2024/9/8 17:40
 * @Version: V1.0.0
 */

namespace app\common\logic;

use tpext\common\model;

class WebConfigLogic
{
    public function __construct()
    {
    }

    /**
     * 获取配置信息
     * @return array|mixed
     */
    public function getConfig($key)
    {
        $webConfig = model\WebConfig::where('key', $key)->find();
        if ($webConfig) {
            return json_decode($webConfig['config'], true);
        } else {
            return [];
        }
    }

}